#!/usr/bin/python

s = ''
for i in range(256):
	s += chr(i)

print 'str - just binary string/buffer (don\'t likes to zero-terminated strings in C)'
print 'repr(s):'
print repr(s)
print 'str(s):'
print s

fname = 'str_byte_buffer.bin'
print 'Binary Write to file: ' + fname
f = open(fname,'w')
f.write(s)
f.close()
f = None
print 'Binary Read from file: ' + fname
h = open(fname)
q = h.read()
h.close()
h = None

print 'Binary arrays/strings are similar: ', s == q
